﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DutyView.aspx.cs" Inherits="DutyView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />

    <script src="js/date.js" type="text/javascript" language="javascript"></script>

    <script language="javascript" type="text/javascript">
        function SelectAll() {
            var e = document.getElementsByTagName("input");
            for (var i = 0; i < e.length; i++) {
                if (e[i].type == "checkbox") {
                    if (document.getElementById("selectall").checked == true)
                        e[i].checked = true;
                    else
                        e[i].checked = false;
                }
            }
        } 
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="842" border="0" cellpadding="0" cellspacing="0" align="center">
            <tr style="color: blue; font-size: 14px;">
                <td style="height: 14px">
                    <img src="images/list.gif" width="16px" height="16px" />周末值班人员--&gt;值班人员查询
                </td>
            </tr>
            <tr>
                <td style="height: 18px">
                    值班人员：<asp:DropDownList ID="ddlPrincipal" runat="server" Width="120px">
                    </asp:DropDownList>
                    值班时间：<asp:TextBox ID="txtDate1" runat="server" MaxLength="20" Width="60px" onfocus="javascript:HS_setDate(this,'btnSelect');"></asp:TextBox>-
                    <asp:TextBox ID="txtDate2" runat="server" MaxLength="20" Width="60px" onfocus="javascript:HS_setDate(this,'btnSelect');"></asp:TextBox>
                    <asp:Button ID="Button1" runat="server" Style="display: none" />
                    任务关键字：<asp:TextBox ID="txtDescription" runat="server"></asp:TextBox>
                    <asp:Button ID="btnSelect" runat="server" Style="display: none" />
                    <asp:Button ID="Btn_Query" runat="server" OnClick="Btn_Query_Click" Text="查询" />
                    <asp:Button ID="btnDel" runat="server" OnClick="btnDel_Click" Text="删除" OnClientClick="return confirm('您确认要删除该记录吗?');" /><br />
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
                        DataKeyNames="ID" CellPadding="3" CellSpacing="2" DataSourceID="PrincipalInfoDataSource"
                        OnRowDataBound="GridView1_RowDataBound" Width="842px">
                        <FooterStyle BackColor="#6A5ACD" />
                        <RowStyle BackColor="#D6DFF7" ForeColor="#8C4510" />
                        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                        <PagerStyle ForeColor="#FFFFFF" HorizontalAlign="Center" BackColor="#6A5ACD" />
                        <HeaderStyle BackColor="#799AE1" Font-Bold="True" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <input type="checkbox" id="selectall" onclick="SelectAll()">
                                    <asp:Label ID="lb" runat="server">全选</asp:Label>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbox" runat="server" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" Width="50px" VerticalAlign="Top" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="Person" HeaderText="值班人员" SortExpression="Person" ItemStyle-Width="60px" />
                            <asp:BoundField DataField="Date" HeaderText="值班时间" SortExpression="Date" DataFormatString="{0:yyyy-MM-dd}"
                                HtmlEncode="false" ItemStyle-Width="100px" />
                            <asp:BoundField DataField="PhoneNumber" HeaderText="联系电话" SortExpression="PhoneNumber"
                                ItemStyle-Width="100px" />
                            <asp:BoundField DataField="Description" HeaderText="任务描述" SortExpression="Description" />
                            <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="DutyManage.aspx?type=2&id={0}"
                                HeaderText="详细" Text="&lt;img src='images/edit.gif' height=15 width=15 border=0&gt;详细"
                                ItemStyle-Width="60px" />
                        </Columns>
                    </asp:GridView>
                    &nbsp; &nbsp;
                    <br />
                    <asp:SqlDataSource ID="PrincipalInfoDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                        SelectCommand="SELECT [ID], [Person], [Date], [PhoneNumber], [Description] FROM [DutyView]">
                    </asp:SqlDataSource>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
